<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>会员中心</title>
    <!-- Bootstrap -->
    <link href="../../../../statics/shuafen/css/bootstrap.min.css" rel="stylesheet">
    <link href="../../../../statics/shuafen/css/profile_style.css" rel="stylesheet">
    <link href="../../../../statics/shuafen/css/response.css" rel="stylesheet">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="../../../../statics/shuafen/js/lib/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="../../../../statics/shuafen/js/lib/bootstrap.min.js"></script>
<script src="../../../../statics/shuafen/js/lib/style.js"></script>
<script type="text/javascript">
	function checkVip(vip){
        if(vip == 1){
            return true;
        }else{
            $("#modelText").text("您还不是VIP用户，不能使用此功能，充值即可升级为VIP用户！");
            $('#myModal').modal();
            return false;
        }
	}
    //购买SVIP
    function checkSvip(vip){
        if(vip == 1){
            $.ajax({
                url : "index.php?m=shuafen&c=web&a=buySvip",
                success : function (rs){
                    if(rs.iserror){
                        msg = rs.message;
                        $("#modelText").text(msg);
                        $('#myModal').modal();
                        return false;
                    }else{
                        $("#modelText2").text("本次购买共需花费" +rs.message + "元");
                        $('#myModal2').modal();
                    }
                },
                dataType : 'json'
            });
        }else{
            $("#modelText").text("您还不是VIP用户，不能使用此功能，充值即可升级为VIP用户！");
            $('#myModal').modal();
            return false;
        }
    }
    //确认支付
    function buyProduct(){
        $.ajax({
            url : "index.php?m=shuafen&c=web&a=buySvip&submit=1",
            success : function (rs){
                $('#myModal2').modal('hide');
                if(rs.iserror){
                    msg = rs.message;
                }else{
                    msg = rs.message;
                }
                $("#modelText").text(msg);
                $('#myModal').modal();
                return false;
            },
            dataType : 'json'
        });
    }
</script>
  </head>
  <body>
    <h1 class="logo">会员中心</h1>
    <div class="usercenter">
		<div class="userinfo">
			<div><span>{$member['nickname']}</span></div>
			<div><span><a  href="index.php?m=shuafen&c=web&a=loginOut">注销</a></span></div>
			<div><span><a  href="index.php?m=shuafen&c=web&a=updateMyInfo">修改我的信息</a></span></div>
		</div>
		<div><img width="90" height="90" class="img-circle" src='../../../../statics/shuafen/images/avatar/<?php echo $member["img"]?>'/></div>
	</div>
    <div class="proinfo pro-user">
     <table>
      <tr>
       	<th style="color:#333;">您是{$user_type}用户,可用余额为{$member[amount]}元</th>
       </tr>
      <tr>
       <th style="color:#333;"><a href="index.php?m=shuafen&c=web&a=myInfo">查看我的信息</a></th>
      </tr>
      <tr>
       <th style="color:#333;"><a href="index.php?m=shuafen&c=web&a=updatePassword">修改密码</a></th>
      </tr>
      <tr>
       <th style="color:#333;"><a href="index.php?m=shuafen&c=web&a=recharge">充值</a></th>
      </tr>
        <tr>
       <th style="color:#333;"><a href="index.php?m=shuafen&c=web&a=transfer" onclick="return checkVip(<?php echo $member[vip] =='Y'?1:0; ?>);">转账</a></th>
      </tr>
       <tr>
       <th style="color:#333;"><a href="index.php?m=shuafen&c=web&a=buyTimes&type=lineup" onclick="return checkVip(<?php echo $member[vip] =='Y'?1:0; ?>);">购买被加次数</a></th>
      </tr>
      <tr>
       <th style="color:#333;"><a href="index.php?m=shuafen&c=web&a=buyTimes&type=downtimes" onclick="return checkVip(<?php echo $member[vip] =='Y'?1:0; ?>);">购买普通下载次数</a></th>
      </tr>
      <tr>
       <th style="color:#333;"><a href="index.php?m=shuafen&c=web&a=buyTimes&type=searchtimes" onclick="return checkVip(<?php echo $member[vip] =='Y'?1:0; ?>);">购买精确下载次数</a></th>
       </tr>
         <tr>
             <th style="color:#333;"><a href="#" onclick="return checkSvip(<?php echo $member[vip] =='Y'?1:0; ?>);">购买SVIP</a></th>
         </tr>
       <tr>
       <th style="color:#333;"><a href="index.php?m=shuafen&c=web&a=free_add&vip=true" onclick="return checkVip(<?php echo $member[vip] =='Y'?1:0; ?>);">免费资源</a></th>
       </tr>

     </table>
    </div><!--proinfo/-->
    <br/>
    <div class="heights">&nbsp;</div>
    <!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
   <div class="modal-dialog">
      <div class="modal-content">
         <div class="modal-header">
            <button type="button" class="close"
               data-dismiss="modal" aria-hidden="true">
                  &times;
            </button>
            <h4 class="modal-title" id="myModalLabel">
               	提醒
            </h4>
         </div>
         <div class="modal-body" id="modelText">
         </div>
         <div class="modal-footer">
            <button type="button" class="btn btn-default"
               data-dismiss="modal">关闭
            </button>
         </div>
      </div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
    <!-- 模态框（Modal） -->
    <div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close"
                            data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel2">
                        购买提醒
                    </h4>
                </div>
                <div class="modal-body" id="modelText2">
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default"
                            data-dismiss="modal">取消
                    </button>
                    <button type="button" class="btn btn-primary" onclick="buyProduct();">
                        确定支付
                    </button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
    {template 'shuafen', 'footer'}
  </body>
</html>